//题目描述
//
//(1)定义人员类Person:
//公有成员：姓名（Name）；
//保护成员：性别（Gender），年龄（Age）；
//
//构造函数和析构函数
//
//(2) 从人员类Person派生学生记录类StudentRecord：
//添加公有成员：学号（Number），班级（ClassName），
//添加静态公有成员：学生总人数（TotalCount）；
//添加保护成员：平均成绩（Score）；
//实现构造函数和析构函数。
//(3) 从人员类Person派生教师记录类TeacherRecord：
//添加公有成员：学院（CollegeName），系（DepartmentName）；
//添加保护成员：教龄（Year）；
//实现构造函数和析构函数。
//
//
//(4)从学生记录类StudentRecord和教师记录类TeacherRecord派生学生助教类TeachingAssistant：
//添加公有成员：辅导课程（LectureName）；
//实现公有函数：显示人员信息（Show），屏幕打印 姓名，性别，年龄，学号，班级，学生总人数，平均成绩，学院，系，教龄，辅导课程。
//实现构造函数和析构函数。为检验类间结构设计是否正确，设计函数void SetName(String name)实现更改一名助教的姓名的功能。
//
//创建一个助教类的对象
//
//助教
//姓名 性别 年龄 学号 班级 平均成绩 学院 系 教龄 辅导课程
//郑七 男 22 2010123 软20101 89         信息 软件    1 数据结构
//显示其信息。
//
//调用更改姓名的函数，更改其姓名为“郑八”，并再次显示其信息。

#include <iostream>
#include <string>

using namespace std;

class Person 
{
public:
	string Name;
	string Gender;
	int Age;
	Person(){}
	Person(string name, string gender, int age);
	~Person();
};


class StudentRecord : virtual public Person
{
public:
	int Number;
	string ClassName;
	static int TotalCount;
	StudentRecord(){}
	StudentRecord(string name, string gender, int age, 
		int number, string classname, int score);
	~StudentRecord();
protected:
	int Score;
};
int StudentRecord::TotalCount = 0;

class TeacherRecord : virtual public Person
{
public:
	string CollegeName;
	string DepartmentName;
	TeacherRecord(){}
	TeacherRecord(string name, string gender, int age, 
		string collegename, string departmentname, int year);
	~TeacherRecord();
protected:
	int Year;
};

class TeachingAssistant : public StudentRecord, public TeacherRecord
{
public:
	string LectureName;
	void Show();
	void SetName(string name);
	TeachingAssistant(){}
	TeachingAssistant(string name, string gender, int age, 
		int number, string classname, int score, string collegename, 
		string departmentname, int year,  string lecturename);
	~TeachingAssistant();
};

int main()
{
	TeachingAssistant v("郑七", "男", 22, 2010123, "软20101", 89, "信息", "软件", 1, "数据结构");
	v.Show();
	v.SetName("郑八");
	v.Show();

	return 0;
}

Person::Person(string name, string gender, int age) : Name(name), Gender(gender), Age(age)
{
	cout << "Person" << Name << "constructed" << endl;
}

Person::~Person()
{
	cout << "Person" << Name << "destructed" << endl;
}

StudentRecord::StudentRecord(string name, string gender, int age, 
	int number, string classname, int score) : Person(name,gender,age)
{
	this->TotalCount ++;
	Number = number, ClassName = classname, Score = score;
	cout << "Student" << Name << "constructed" << endl;
}

StudentRecord::~StudentRecord()
{
	cout << "Student" << Name << "destructed" << endl;
}

TeacherRecord::TeacherRecord(string name, string gender, int age, 
	string collegename, string departmentname, int year) : Person(name, gender, age)
{
	CollegeName = collegename;
	DepartmentName = departmentname;
	Year = year;
	cout << "teacher" << Name << "constructed" << endl;
}

TeacherRecord::~TeacherRecord()
{
	cout << "teacher" << Name << "destructed" << endl;
}

void TeachingAssistant::Show()
{
	cout << "Name:" << Name << " "
		<< "Gender:" << Gender << " "
		<< "Age:" << Age << " "
		<< "Number:" << Number << " "
		<< "ClassName:" << ClassName << " "
		<< "TotalCount:" << TotalCount << " "
		<< "Score:" << Score << " "
		<< "CollegeName:" << CollegeName << " "
		<< "DepartmentName:" << DepartmentName << " "
		<< "Year:" << Year << " "
		<< "LectureName:" << LectureName << endl;
}

void TeachingAssistant::SetName(string name)
{
	Name = name;
}

TeachingAssistant::TeachingAssistant(string name, string gender, int age,
	int number, string classname, int score, string collegename, 
	string departmentname, int year, string lecturename) : 
		Person(name, gender, age), 
		StudentRecord(name,gender,age,number,classname,score), 
		TeacherRecord(name,gender,age,collegename,departmentname,year)
{
	LectureName = lecturename;
	cout << "teachingassistant" << Name << "constructed" << endl;
}

TeachingAssistant::~TeachingAssistant()
{
	cout << "teachingassistant" << Name << "destructed" << endl;
}
